package com.heima.wemedia.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.wmmedia.dtos.NewsAuthDTO;
import com.heima.model.wmmedia.pojos.WmNews;
import com.heima.model.wmmedia.vos.WmNewsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WmNewsMapper extends BaseMapper<WmNews> {

    //分页查询文章列表和作者
    List<WmNewsVO> findList(@Param("dto") NewsAuthDTO dto);

    //查询总条数
    Integer count(@Param("dto") NewsAuthDTO dto);

    //根据文章id查询文章和作者详情
    WmNewsVO findWmNewsVo(@Param("id") Integer id);
}